<div class="modal fade" id="modal-move-module" tabindex="-1" role="dialog" aria-labelledby="modal-move-module-label">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close"></i></button>
        <h4 class="modal-title" id="modal-move-module-label"><%=t "experiments.canvas.edit.modal_move_module.title" %></h4>
      </div>
      <div class="modal-body">
        <% experiments = @experiment.project.experiments.managable_by_user(current_user).order(name: :asc).active %>
        <% if experiments.count > 1 %>
          <%= form_with do |f| %>
            <%= f.select :experiment_id, experiments
                                        .select { |e| e != @experiment && can_manage_experiment?(e) }
                                        .collect { |e| [ e.name, e.id ] }, {},
                {class: "form-control selectpicker", "data-role" => "clear"} %>
          <% end %>
        <% else %>
          <div>
            <em>
              <%= t("experiments.canvas.edit.modal_move_module.no_experiments") %>
            </em>
          </div>
        <% end %>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
        <% if experiments.count > 1 %>
          <button type="button" class="btn btn-primary" data-action="confirm">
            <%=t "experiments.canvas.edit.modal_move_module.confirm" %>
          </button>
        <% end %>
      </div>
    </div>
  </div>
</div>
